import { PartialType } from '@nestjs/mapped-types';
import { CreateArticleDto } from './create-article.dto';
import { IsArray, IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { Tags } from 'src/database/tags.entity';

export class UpdateArticleDto extends PartialType(CreateArticleDto) {
  @IsString()
  @IsNotEmpty()
  title: string;

  @IsString()
  @IsNotEmpty()
  content: string;

  @IsOptional()
  imgUrl: string;

  @IsOptional()
  desc: string;

  @IsArray()
  tags: Tags[];
}
